# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-microdata
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=microdata
pkgver=0.8.0
pkgrel=0
pkgdesc="html5lib extension for parsing microdata"
url="https://pypi.python.org/project/microdata"
license="CC0-1.0"
arch="noarch"
depends="py3-html5lib"
makedepends="py3-setuptools py3-gpep517 py3-wheel"
source="$pkgname-$pkgver.tar.gz::https://github.com/edsu/microdata/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"
subpackages="$pkgname-pyc"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 setup.py test
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
e48c8c267f595faec97397fae470a3aa1f4f33d9f4ea7d186f07b104166b373ea768db7d73423aedd28af3e310f6b9fa268d946420c6aed9676d15f38396b07e  py3-microdata-0.8.0.tar.gz
"
